package com.gin.supermarket_inventory_system.commodity.dto.form;

import com.gin.database.validation.EntityId;
import com.gin.supermarket_inventory_system.commodity.entity.CommodityProducerPo;
import com.gin.supermarket_inventory_system.commodity.service.CommodityProducerService;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 添加商品生产商
 * @since : 2023/10/9 14:28
 * @author : ginstone
 * @version : v1.0.0
 **/
@Getter
@Setter
@Schema(description = "表单对象:添加商品生产商")
public class CommodityProducerAddForm {
    @Schema(description = "名称")
    @NotEmpty
    List<String> name;
    public List<CommodityProducerPo> toPoList() {
        return name.stream().map(CommodityProducerPo::new).toList();
    }
}